/**
 * Created by CodeTlan.
 * User: Ing. Miguel Salas
 * Date: 3/11/12
 * Time: 5:00 PM
 */
Ext.define('CT.view.contrato.Grid', {
    extend: 'Ctc.view.EditorGrid',
    alias:"widget.gridcontrato",
    store:'Contratos',
    requires: 'Ext.ux.grid.checkcolumn.CheckColumn',
    buildColumns: function(){
        return [
            { xtype: 'rownumberer'},
            { header: 'Ficha', dataIndex: 'ficha', align: 'center', width: 50},
            { header: 'Contrato', dataIndex: 'contrato', align: 'center', width: 80 },
            { header: 'Nombre', dataIndex: 'nombreap', flex: 2},
            { header: 'Departamento', dataIndex: 'departamento', flex: 1, minWidth: 80 },
            { header: 'Categoria', dataIndex: 'categoria', flex: 1, minWidth: 80 },
            { header: 'Inicio', dataIndex: 'fecha_inicio', align: 'center', width: 70, editor: { xtype:'datemx', allowBlank: false }, renderer: Ext.util.Format.dateRenderer('d/m/Y')},
            { header: 'Fin', dataIndex: 'fecha_fin', align: 'center', width: 70, editor: { xtype:'datemx', allowBlank: false }, renderer: Ext.util.Format.dateRenderer('d/m/Y')},
            { header: 'Dias', dataIndex: 'dias', align:'center',width: 47, editor: { xtype: 'numberfield', vtype: 'num', minValue: 0, maxValue: 360, allowBlank: false }},
            { align: 'center', width: 30, renderer: this._renderEliminar, editor:{xtype:'hiddenfield'}}
        ];
    },
    _renderEliminar: function(value){
        return "<img src='img/icons/16/del.png' style:'cursor:pointer'>";
    }
});